import request from '@/utils/request'
// -------- 法规 --------

let BASE_ADDRESS = 'doc/law'

//  查询法规标题
export function getLawListTitleApi(params) {
    return request({
        url: `${BASE_ADDRESS}/listTitle`,
        method: "get",
        params
    })
}
//  分页查询
export function getLawListApi(params) {
    return request({
        url: `${BASE_ADDRESS}/list`,
        method: "get",
        params
    })
}

//获取解答的数据列表  /doc/overall/qaList
export const getOverallQaListApi = (params) =>{
    return request({
        url:'/doc/overall/qaList',
        method:'get',
        params
    })
}

//获取政策的文章列表 /doc/overall/lawList
export const getOveratopListApi = (params) =>{
    return request({
        url:'/doc/overall/topList',
        method:'get',
        params
    })
}
// // 查询法律标题
// export function getLawListTitleApi(params) {
//     return request({
//         url: `${BASE_ADDRESS}/listTitle`,
//         method: "get",
//         params
//     })
// }

// 根据id查询
export function getLawInfoApi(params) {
    return request({
        url: `${BASE_ADDRESS}/getInfo?id=${params}`,  // /doc/law/getInfo
        method: "get",

    })
}


// 编辑
export function getLawEditApi(data) {
    return request({
        url: `${BASE_ADDRESS}/edit`,
        method: "put",
        data
    })
}

// 下架
export function getLawUpdateStatusApi(data) {
    return request({
        url: `${BASE_ADDRESS}/updateStatus`,
        method: "put",
        data
    })
}
// 记录点击数
export function getLawClickApi(data) {
    return request({
        url: `${BASE_ADDRESS}/click?id=${data}`,
        method: "put",
    })
}